﻿
@{
    Layout = null;
}

<!DOCTYPE html>

<html>
<head>
    <meta name="viewport" content="width=device-width" />
    <title>登录-文件浏览系统</title>
    <style type="text/css">
        .div_line
        {
            height: 40px;
            margin-top: 20px;
            font-size: 18px;
            margin-left: 46px;
        }
        label { width: 120px; display: inline-block; text-align: right; font-weight: bold; }
        input { height: 36px; font-size: 18px; font-size: 22px; }
    </style>
    <script src="~/Scripts/jquery-3.4.1.min.js"></script>

</head>
<body>
   
    <div style="margin:100px auto;width:600px;">
        <h1 style="text-align:center;margin-bottom:30px;">文件浏览系统</h1>
        <div class="div_line">
            <label>用户名</label>
            <input type="text" id="account" style="width:300px;" />
        </div>
        <div class="div_line">
            <label>密码</label>
            <input type="password" id="password" style="width:300px;" />
        </div>
        <div id="showMsg" class="div_line" style="font-size:23px; font-weight:bold;text-align:center;">
            &nbsp;
        </div>
        <div class="div_line" style="text-align:center;">
            <input type="button" id="btnLogin" value="登录" onclick="myLogin()" style="width:310px;" />
        </div>
    </div>

    <script type="text/javascript">
        !function (w) {
            w.myLogin = function () {
                $.ajax({
                    url: "/LoginHandle/DoLogin",
                    type: "post",
                    data: {
                        account: $("#account").val(),
                        pwd: $("#password").val(),
                    },
                    success: function (r) {
                        if (r.Code == 500) {
                            $("#showMsg").css("color","red");
                            $("#showMsg").html(r.Msg);
                            return;
                        }
                        $("#showMsg").css("color", "green");
                        $("#showMsg").html(r.Msg);
                        window.location.href = "/home/FileList";
                    }
                });
            }
        }(window);
    </script>
</body>
</html>
